import axios from './axios'

// 1. 获取服务中心数据 get
export const getService = () => {
    return axios.get("v3/profile/explain").catch(err => {
        console.log(err)
    })
}

// 2. 获取用户信息
export const getUserinform = (user_id) => {
    return axios.get("v1/user?user_id="+user_id).catch(err=>{
        console.log(err)
    })
}

// 3. 可用红包
export const getHongbao = (user_id) => {
    return axios.get("promotion/v2/users/"+user_id+"/hongbaos?limit=20&offset=0").catch(err => {
        console.log(err)
    })
}

// 获取过期红包
export const getExHongbao = (user_id) => {
    return axios.get("promotion/v2/users/"+user_id+"/expired_hongbaos?limit=20&offset=0").catch(err => {
        console.log(err)
    })
}




// 获取登录数据
export const getLogin = (username, password, captcha_code) => {
    return axios.post("v2/login", {

        username: username,
        password: password,
        captcha_code: captcha_code,

    }).catch(err => {
        console.log(err)
    });
}